import { Sequelize } from "sequelize";
const sequelize = new Sequelize("koa_crud", "root", "root", {
  host: "localhost",
  dialect: "mysql",
  pool: {
    max: 5,
    min: 0,
    idle: 10000,
  },
});
// const sequelize = new Sequelize("koa-xixi", "xixi", "root", {
//   host: "180.184.83.112",
//   dialect: "mysql",
//   pool: {
//     max: 5,
//     min: 0,
//     idle: 10000,
//   },
// });
sequelize
  .authenticate()
  .then(() => {
    console.log("Connection has been established successfully.");
  })
  .catch((error) => {
    console.log("Unable to connect to the database:", error);
  });
export default sequelize;
